
  
  <li class="layui-nav-item" style="height: 30px; text-align: center"></li>
<span class="layui-nav-bar" style="top: 107.5px; height: 0px; opacity: 0;"></span></ul>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
  <legend>完整功能（没错，目前工具栏只有这么多）</legend>
</fieldset>
 
<textarea class="layui-textarea layui-hide" id="LAY_demo1" style="display: none">  
  把编辑器的初始内容放在这textarea即可
</textarea>
<div class="layui-layedit">
  <div class="layui-unselect layui-layedit-tool">
    <i class="layui-icon layedit-tool-b" title="加粗" lay-command="Bold" layedit-event="b" "=""></i>
    <i class="layui-icon layedit-tool-i" title="斜体" lay-command="italic" layedit-event="i" "=""></i>
    <i class="layui-icon layedit-tool-u" title="下划线" lay-command="underline" layedit-event="u" "=""></i><i class="layui-icon layedit-tool-d" title="删除线" lay-command="strikeThrough" layedit-event="d" "=""></i>
    <span class="layedit-tool-mid"></span>
    <i class="layui-icon layedit-tool-left" title="左对齐" lay-command="justifyLeft" layedit-event="left" "=""></i><i class="layui-icon layedit-tool-center" title="居中对齐" lay-command="justifyCenter" layedit-event="center" "=""></i>
    <i class="layui-icon layedit-tool-right" title="右对齐" lay-command="justifyRight" layedit-event="right" "=""></i><span class="layedit-tool-mid"></span><i class="layui-icon layedit-tool-link" title="插入链接" layedit-event="link" "=""></i>
    <i class="layui-icon layedit-tool-unlink layui-disabled" title="清除链接" lay-command="unlink" layedit-event="unlink" "=""></i><i class="layui-icon layedit-tool-face" title="表情" layedit-event="face" "=""></i>
    <i class="layui-icon layedit-tool-image" title="图片" layedit-event="image">
      <input name="file" type="file">
    </i>
    </div>
    <div class="layui-layedit-iframe">
      <iframe id="LAY_layedit_1" name="LAY_layedit_1" textarea="LAY_demo1" style="height: 280px;" frameborder="0">
      </iframe>
  </div>
</div>
 
<script>
layui.config({
  base: '//res.layui.com/lay/modules/layui/'
  ,version: '1481073704865'
}).use('global');
 
window.global = {
  preview: function(){
    var preview = document.getElementById('LAY_preview');
    return preview ? preview.innerHTML : '';
  }()
};
</script>
<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_30088308'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "w.cnzz.com/c.php%3Fid%3D30088308' type='text/javascript'%3E%3C/script%3E"));</script><span id="cnzz_stat_icon_30088308"></span><script src=" http://w.cnzz.com/c.php?id=30088308" type="text/javascript"></script>
</div>
<div id="LAY_democodejs">
<script>
layui.use('layedit', function(){
  var layedit = layui.layedit
  ,$ = layui.jquery;
  
  //构建一个默认的编辑器
  var index = layedit.build('LAY_demo1');
  
  //编辑器外部操作
  var active = {
    content: function(){
      alert(layedit.getContent(index)); //获取编辑器内容
    }
    ,text: function(){
      alert(layedit.getText(index)); //获取编辑器纯文本内容
    }
    ,selection: function(){
      alert(layedit.getSelection(index));
    }
  };
  
  $('.site-demo-layedit').on('click', function(){
    var type = $(this).data('type');
    active[type] ? active[type].call(this) : '';
  });
  
  //自定义工具栏
  layedit.build('LAY_demo2', {
    tool: ['face', 'link', 'unlink', '|', 'left', 'center', 'right']
    ,height: 100
  })
});
</script>
</div>

<ul class="layui-fixbar"><li class="layui-icon" lay-type="bar1" style=""></li><li class="layui-icon layui-fixbar-top" lay-type="top" style=""></li></ul><div class="layui-layer-move"></div></body></html>